//
//package com.rt.schedulebase.service.impl;
//import com.rt.schedulebase.dto.DictScheduleApmDto;
//import com.rt.schedulenew.utils.base.BigDecimalUtil;
//import com.rt.schedulenew.utils.base.LogUtil;
//import com.rt.schedulenew.utils.base.ConstantsUtil;
//import com.rt.schedulebase.dto.DictUsersDto;
//import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
//import com.baomidou.mybatisplus.core.conditions.Wrapper;
//import java.util.Map;
//import java.util.HashMap;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import java.util.List;
//import com.rt.schedulebase.dto.ExamSyslogDto;
//import java.io.Serializable;
//
//import com.rt.schedulenew.utils.util.DateUtil;
//import org.springframework.stereotype.Service;
//import com.rt.schedulebase.service.IExamSyslogService;
//import com.rt.schedulebase.entity.ExamSyslog;
//import com.rt.schedulebase.mapper.ExamSyslogMapper;
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//@Service
//public class ExamSyslogServiceImpl extends ServiceImpl<ExamSyslogMapper, ExamSyslog> implements IExamSyslogService {
//    @Override
//    public boolean insertSelective(final ExamSyslog examSyslog) {
//        return this.retBool(baseMapper.insert(examSyslog));
//    }
//    @Override
//    public boolean deleteByPrimaryKey(final String key) {
//        return this.retBool(Integer.valueOf(((ExamSyslogMapper) this.baseMapper).deleteById((Serializable) key)));
//    }
//    @Override
//    public boolean updateByPrimaryKeySelective(final ExamSyslog examSyslog) {
//        return this.retBool(Integer.valueOf(((ExamSyslogMapper) this.baseMapper).updateById(examSyslog)));
//    }
//    @Override
//    public ExamSyslog selectByPrimaryKey(final String key) {
//        return (ExamSyslog) ((ExamSyslogMapper) this.baseMapper).selectById((Serializable) key);
//    }
//    @Override
//    public List<ExamSyslog> getList(final ExamSyslogDto dto) {
//        final QueryWrapper<ExamSyslog> qw = (QueryWrapper<ExamSyslog>) new QueryWrapper();
//        final Map<String, Object> map = new HashMap<String, Object>();
//        qw.allEq((Map) map, false);
//        final List<ExamSyslog> list = (List<ExamSyslog>) ((ExamSyslogMapper) this.baseMapper).selectList((Wrapper) qw);
//        return list;
//    }
//    @Override
//    public List<ExamSyslog> getListAll() {
//        return (List<ExamSyslog>) ((ExamSyslogMapper) this.baseMapper).selectList((Wrapper) null);
//    }
//    @Override
//    public boolean delete(final ExamSyslog examSyslog) {
//        final UpdateWrapper<ExamSyslog> uw = (UpdateWrapper<ExamSyslog>) new UpdateWrapper();
//        final Map<String, Object> map = new HashMap<String, Object>();
//        uw.allEq((Map) map, false);
//        return this.retBool(Integer.valueOf(((ExamSyslogMapper) this.baseMapper).delete((Wrapper) uw)));
//    }
//    @Override
//    public boolean update(final ExamSyslog examSyslog) {
//        final UpdateWrapper<ExamSyslog> uw = (UpdateWrapper<ExamSyslog>) new UpdateWrapper();
//        final Map<String, Object> map = new HashMap<String, Object>();
//        uw.allEq((Map) map, false);
//        return this.retBool(Integer.valueOf(((ExamSyslogMapper) this.baseMapper).update(examSyslog, (Wrapper) uw)));
//    }
//    @Override
//    public ExamSyslog getInfo(final ExamSyslogDto dto) {
//        final QueryWrapper<ExamSyslog> qw = (QueryWrapper<ExamSyslog>) new QueryWrapper();
//        final Map<String, Object> map = new HashMap<String, Object>();
//        qw.allEq((Map) map, false);
//        return (ExamSyslog) ((ExamSyslogMapper) this.baseMapper).selectOne((Wrapper) qw);
//    }
//    @Override
//    public void insertSysLog(final ExamSyslog examSyslog, final DictUsersDto dictUsersDto, final Object oldObj, final Object newObj, final String keyName) {
//        final StringBuilder sb = new StringBuilder();
//        sb.append("【");
//        sb.append(ConstantsUtil.OperateName.get(examSyslog.getOperateName()));
//        sb.append("--");
//        sb.append(ConstantsUtil.ModuleName.get(examSyslog.getModuleName()));
//        sb.append("--");
//        sb.append(keyName);
//        sb.append("】");
//        if (ConstantsUtil.OperateName.UPDATE.name().equals(examSyslog.getOperateName())) {
//            final String str = LogUtil.compareObject(oldObj, newObj);
//            sb.append(str);
//        }
//        final ExamSyslog syslog = new ExamSyslog();
//        syslog.setOperateName(ConstantsUtil.OperateName.get(examSyslog.getOperateName()));
//        syslog.setModuleName(examSyslog.getModuleName());
//        syslog.setUserId(dictUsersDto.getUserId());
//        syslog.setUserName(dictUsersDto.getName());
//        syslog.setComputerName(dictUsersDto.getIpAddress());
//        syslog.setPatLocalId(examSyslog.getPatLocalId());
//        syslog.setOperateDate(DateUtil.getCurrDate());
//        syslog.setOperateTime(DateUtil.getCurrentTime());
//        final int length = sb.length();
//        double num = BigDecimalUtil.divide(length, 2000.0);
//        num = (Math.max(num, 1.0));
//        for (int i = 0; i < num; ++i) {
//            final int startIdx = i * 2000;
//            int endIdx = (i + 1) * 2000;
//            endIdx = (Math.min(endIdx, length));
//            final String desc = sb.substring(startIdx, endIdx);
//            syslog.setDescription(desc);
//            this.insertSelective(syslog);
//        }
//    }
//    public static void main(final String[] args) {
//        final String moduleName = ConstantsUtil.ModuleName.DICT_SCHEDULE_APM_COMMON.name();
//        final String operateName = ConstantsUtil.OperateName.UPDATE.name();
//        final DictScheduleApmDto oldObj = new DictScheduleApmDto();
//        oldObj.setApmCode("123");
//        oldObj.setPageNo(1);
//        final DictScheduleApmDto newObj = new DictScheduleApmDto();
//        newObj.setApmCode("4561");
//        newObj.setPageNo(2);
//        final ExamSyslog examSyslog = new ExamSyslog();
//        examSyslog.setModuleName(moduleName);
//        examSyslog.setOperateName(operateName);
//    }
//}
